<template>
  <div class="legend">
    <h3>节点状态图例</h3>
    <div class="legend-items">
      <div class="legend-item">
        <div class="legend-dot master-ready"></div>
        <span>主节点 (就绪)</span>
      </div>
      <div class="legend-item">
        <div class="legend-dot master-notready"></div>
        <span>主节点 (异常)</span>
      </div>
      <div class="legend-item">
        <div class="legend-dot worker-ready"></div>
        <span>工作节点 (就绪)</span>
      </div>
      <div class="legend-item">
        <div class="legend-dot worker-notready"></div>
        <span>工作节点 (异常)</span>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
// 纯展示组件，无需 props
</script>

<style scoped>
.legend {
  margin-top: 24px;
}
.legend-items {
  display: flex;
  gap: 24px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.legend-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #d9d9d9;
}
.master-ready {
  background: #52c41a;
  border-color: #1890ff;
}
.master-notready {
  background: #ff4d4f;
  border-color: #1890ff;
}
.worker-ready {
  background: #1890ff;
  border-color: #52c41a;
}
.worker-notready {
  background: #ff4d4f;
  border-color: #52c41a;
}
</style>

